1. Field of the Invention
The present invention relates to an image processing apparatus provided with an error compensation process and a method therefor, adapted for use in an apparatus or a system for encoding/decoding image information.
2. Related Background Art
As an encoding method for storing and displaying a still image in an accumulating medium (recording medium) such as a CD-ROM or a hard disk, there has been widely employed a JPEG (Joint Photographic Expert Group) method standardized by ISO (International Organization for Standardization). On the other hand, for storing and displaying a moving image like the still image, or for broadcasting or bidirectional communication through a communication channel, there has been widely employed an MPEG (Moving Picture Expert Group) method standardized by ISO.
In the encoding of image information with either of the JPEG method and the MPEG method, there is generated an encoded data train constituted of a header portion including information necessary for decoding the image, such as an image size, a number of color components constituting the image, a sampling coefficient for each color component etc., and an image data portion which is entropy encoded by a variable length code.
The present invention is applicable to both a still image and a moving image, but there will be explained hereinafter an encoding and a decoding of a still image for the purpose of simplicity.
At first, in case of encoding a still image by a block interleave method in which a color component is encoded repeatedly for each block of 8×8 pixels, a minimum unit for encoding blocks of all the color components on the basis of a sampling coefficient is called “minimum coding unit (MCU)”.
For example, in case a color image is constituted of a luminance component Y and color difference components Cb, Cr and has a sampling ratio of 2:1:1 in the horizontal direction and 1:1:1 in the vertical direction, 1 MCU is composed of 4 blocks of (Y, Y, Cb, Cr).
It is also possible, in the encoded data train, to insert an identifier, called restart marker (resynchronizing identifier), at an arbitrary period on the MCU basis. By utilizing such restart marker, it is possible, in decoding an encoded data train including an error for some reason, to suppress an influence of such error at the period of the restart marker.
It is stipulated that the aforementioned restart marker is positioned at a boundary of bytes in the encoded data train. Therefore, in case the encoded data train immediately before the insertion of the restart marker is not terminated at a boundary of a byte, the restart marker is inserted after insertion of successive “1”s of 1 to 7 bits, called padding bits.
In case of decoding an encoded data train including a code error for some reason, such error is mostly detected by either of following phenomena (1) and (2):    (1) detection of a variable length code not existing in a conversion table utilized in the decoding; and    (2) detection of variable length codes more than 64 within a block.
In case restart markers are inserted in the encoded data train, it is possible to execute a search on the encoded data train after a position where a code error is detected and to re-start the decoding from a position where a restart marker is present.
For undecodable encoded data present between the position of detection of the code error and the position where the restart marker is present, there are inserted compensation data to obtain a reproduced image which coincides, in a number of the horizontal pixels and in a number of the vertical pixels, with an original image.
Also, even in case a restart marker is not present in the encoded data train after the position where the code error is detected, there may be inserted compensation data so as to meet the number of the horizontal pixels and the number of the vertical pixels of the original image, thereby enabling to display at least a part of the image before the detection of the code error.
However, in the aforementioned conventional image processing method for decoding encoded image data, a process of executing a search of the restart marker on the encoded data train from the position of detection of the code error and inserting compensation data (error compensation (error repair) process) is an exceptional process and is not executed in the decoding of an ordinary encoded data train not including the code error.
For this reason, the error compensation process is generally not realized by a hardware but realized by a software on a microprocessor in consideration of the cost. However, in terms of the process speed, it cannot be denied that a process by a software requires a longer process time than a process by a hardware.
On the other hand, in case a coder error is once detected in an encoded data train constituted as continuous variable length codes, the only way to understand a level of code errors in the entire encoded data train is to inspect successively the encoded data train after the position where the code error is detected.
Therefore, in case many code errors exist in dispersing manner in a large-size image, there are repeated four processes of a code error detection, a search for a restart marker, a compensation process, and a restarting of decoding. Among these processes, the search for the restart marker and the compensation process, which are generally realized by a software, need a major part of the process time required for the entire decoding. As a result, there is required an extremely longer process time than in the ordinary decoding.
However, in an application in which priority is given to a formation of a reconstructed image faithful to the original image, the above-described compensation process is adopted positively even if a longer process time than in the ordinary decoding process is required. For example, in the decoding process of a still image, the error compensation process is generally adopted since priority is often given to a formation of a reproduced image faithful to the original image.
On the other hand, in an application in which priority is given to completion of the decoding process within a shorter time, it is desired to complete the process within a process time similar to that in the ordinary decoding process.
For example, in a moving image decoding process, the process time permitted for the decoding process is limited since it is required to decode, within 1 second, about 30 images in succession. Also in case of decoding and displaying a moving image, a visual defect to the user is limited even in case one of the consecutive plural images contains certain code errors. Furthermore, even in case one of the consecutive plural images is not usable because of code errors, it is possible to interpolate such image from images positioned time-sequentially close.
Therefore, even in case an encoded data train includes a code error, it is reasonable that the error compensation process is completed within a process time comparable to that in the ordinary decoding process.
However, there has not been a configuration that can satisfy the mutually contradictory requirements for the error compensation (error concealment) process in the aforementioned two different situations, whereby the convenience of the user is significantly impaired.